<?php
class Schengen_Au_Tourism_Model extends CI_Model {

	var $table = 'schengen_au_tourism';

	function __construct()
	{
		parent::__construct();
	}
	
	function get_all()
	{
		$query = $this->db->get($this->table);
		//$query = $this->db->query($this->db->_limit('select * from tudi ',1,0));
		return $query->result();
	}

	function get_one($id){
		$query = $this->db->get_where($this->table, array('id' => $id), 1, 0);
		return $query->row();
	}
	
	function insert_entry($data)
	{
		$this->db->insert($this->table, $data);
		return $this->db->insert_id();
	}

	function update_entry($id, $data)
	{
		$this->db->update($this->table, $data, array('id' => $id));
	}
	
	function delete_entry($id){
		$this->db->delete($this->table, array('id' => $id)); 
		//delete relation data
		//...
	}
}
